import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 菜谱信息
 */
@Entity('recipe_info')
export class RecipeInfoEntity extends BaseEntity {
  @Column({ comment: '封面图片', nullable: true })
  coverImage: string;

  @Index()
  @Column({ comment: '名称' })
  name: string;

  @Index()
  @Column({ comment: '分类ID' })
  categoryId: number;

  @Column({ comment: '浏览量', default: 0 })
  viewCount: number;

  @Column({ comment: '做饭时长（分钟）' })
  cookTime: number;

  @Column({ comment: '做饭时长（分钟）' })
  mark: string;

  @Column({ comment: '食材准备', type: 'text', nullable: true })
  ingredients: string;

  @Column({ comment: '烹饪步骤', type: 'text', nullable: true })
  steps: string;

  @Column({ comment: '烹饪小贴士', type: 'text', nullable: true })
  tips: string;

  @Column({ comment: '状态', dict: ['停用', '启用'], default: 1 })
  status: number;
}
